﻿package frEngine.animateControler.particleControler.animate
{
    import __AS3__.vec.*;
    import flash.geom.*;
    import frEngine.animateControler.particleControler.*;

    public class UseLiXinForce extends Object implements IParticleAnimate
    {
        private var lixinForceSize:Number;
        public static const instance:UseLiXinForce = new UseLiXinForce;

        public function UseLiXinForce()
        {
            return;
        }// end function

        public function get objClass() : Class
        {
            return UseLiXinForce;
        }// end function

        public function canOpen(param1:ParticleParams) : Boolean
        {
            return param1.useLiXinForce;
        }// end function

        public function update(param1:ParticleStatus) : void
        {
            var _loc_4:ParticleItem = null;
            var _loc_5:Vector3D = null;
            var _loc_7:Number = NaN;
            var _loc_8:Number = NaN;
            var _loc_9:Number = NaN;
            var _loc_2:* = param1.particleList;
            var _loc_3:* = _loc_2.length;
            var _loc_6:int = 0;
            while (_loc_6 < _loc_3)
            {
                
                _loc_4 = _loc_2[_loc_6];
                if (_loc_4.visible && _loc_4.toUpdate)
                {
                    _loc_5 = _loc_4.resultPos;
                    _loc_7 = _loc_5.y;
                    _loc_5.y = 0;
                    _loc_8 = _loc_5.length;
                    if (_loc_8 > 0)
                    {
                        _loc_9 = _loc_8 - 0.5 * this.lixinForceSize * _loc_4.curFrame * _loc_4.curFrame;
                        var _loc_10:int = 0;
                        _loc_9 = 0;
                        _loc_5.x = _loc_5.x / _loc_8 * _loc_9;
                        _loc_5.z = _loc_5.z / _loc_8 * _loc_9;
                        _loc_5.y = _loc_7;
                    }
                }
                _loc_6++;
            }
            return;
        }// end function

        public function init(param1:ParticleStatus, param2:ParticleParams) : void
        {
            this.lixinForceSize = param2.lixinForceSize;
            return;
        }// end function

    }
}
